// 品牌管理请求
import request from "@/utils/request.ts";
import {TradeMarkResponseData,TradeMark} from '@/api/product/trademark/type.ts'
enum API {
    //获取商品
    TRADEMARK_URL = '/admin/product/baseTrademark/',
    //添加商品
    ADDTRADEMARK_URL = '/admin/product/baseTrademark/save',
    //修改商品
    UPDATETRADEMARK_URL = '/admin/product/baseTrademark/update',
    //删除已有品牌
    DELETE_URL='/admin/product/baseTrademark/remove/'
}
/**
 * 获取商品
 * @param page
 * @param size
 */
export const reqHasTrademark =(page:number,size:number)=>{
    return request.get<any,TradeMarkResponseData>(API.TRADEMARK_URL+`${page}/${size}`)
}
/**
 * 新增或修改
 * @param data
 */
export const reqAddOrUpdateTrademark = (data:TradeMark)=>{
    if(data.id){
        return request.put<any,any>(API.ADDTRADEMARK_URL,data)
    }else {
        return request.post<any,any>(API.UPDATETRADEMARK_URL,data)
    }
}
/**
 * 删除商品
 * @param id 商品ID
 */
export const reqDeleteTrademark = (id:string)=>request.delete<any,any>(API.DELETE_URL+`${id}`)